<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <div v-html="msg1" :id="id">

    </div>
    <div>
      {{number?number+1:number}}
      <!-- {{number+1}} -->
      <!-- {{message.split('').reverse().join('')}} -->
    </div>
	<div v-n="6"></div>
	<div :class="[a1,a2]">
		 我借你{{money}},你还我{{a}},还剩下{{b}}
	</div>
    <div :class="{'test-1':a3}">
		style object
	</div>
	<!-- <ul>
		<li :key="item1">hello</li>
		<li v-for="item in arr" :key="item">{{item}}</li>
	</ul> -->
	<ul>
		<template v-for="item in arr" >
			<li :key="item+1">hello</li>
			<li :key="item">{{item}}</li>
		</template>
		
	</ul>
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  props: {
    msg: String
  },
  data(){
    return{
      msg1:'<span style="color:red">hello world</span>',
      id:'txt',
      number:1,
	  money:100,
	  a:1,
	  a1:'test-1',
	  a2:'test-2',
	  a3:true,
	  arr:['a','b','c','d']
    }
  },
  computed:{
	  b:function(){
		  return this.money - this.a
	  }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
